<template>
  <div class="interview-info-details">
    <div>
      <span>走访人：</span><span>{{ data.people_name }}</span>
    </div>
    <div>
      <span>走访类型：</span><span>{{ interviewType[data.special_type] }}</span>
    </div>
    <div><span>异常情况：</span><span v-html="data.abnormal_desc"></span></div>
    <div>
      <span>走访说明：</span><span>{{ data.remark || '-' }}</span>
    </div>
    <div><span>附件：</span> <img v-for="(url, index) of urlList" :key="index" :src="url" alt="附件" /></div>
  </div>
</template>

<script>
import { useDicDataStore } from '@gis/lib/pinia/dicData.js';

export default {
  name: 'interview-info-details',
  components: {},
  props: {
    data: { type: Object, default: () => ({}) },
  },
  data() {
    return {
      typeName: 'D0016',
    };
  },
  computed: {
    urlList() {
      return this.data.url ? this.data.url.split(',').filter((item) => !!item) : [];
    },
    interviewType() {
      return this.dicData.getDicData(this.typeName);
    },
  },
  mounted() {
    this.dicData.getDicDataAsync(this.typeName);
  },
  setup() {
    const dicData = useDicDataStore();
    return { dicData };
  },
};
</script>

<style scoped lang="less">
.interview-info-details {
  padding: 24px 20px;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  line-height: 30px;
}
</style>
